package org.demo.warehouse.service.impl;

import org.demo.warehouse.common.pojo.Goods;
import org.demo.warehouse.common.utils.StatisticCollector;
import org.demo.warehouse.mapper.GoodsMapper;
import org.demo.warehouse.service.IGoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zgc
 * @since 2021-12-16
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public Map<String, List<Object>> statistic() {
        return goodsMapper.statistic().stream().collect(StatisticCollector.getInstance());
    }
}
